﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using eTMS.Controllers;

namespace eTMS.Forms.Students
{
    public partial class FrmSinhVienSearch : eTMS.Controls.BaseForm
    {
        public FrmSinhVienSearch()
        {
            InitializeComponent();
        }
        public void SetHidenList(List<int> LsSinhVien_ID)
        {
            searchSinhVien1.SetHidenList(LsSinhVien_ID);
        }
        private SinhVienController controller;
        public void SetController(SinhVienController sinhVienController)
        {
            controller = sinhVienController;
            searchSinhVien1.SetController(controller);
        }
        public List<DataRow> GetSelectedSinhVien()
        {
            return searchSinhVien1.GetSelectedSinhVienRows();
        }
        public void UpdateObjectToModel()
        {
            this.searchSinhVien1.UpdateObjectToModel();
        }
        private void ucCommandDialog1_OnOK(object sender, CancelEventArgs e)
        {
            searchSinhVien1.UpdateObjectToModel();
            if ((controller.SinhVienObject == null) || (controller.SinhVienObject.SinhVien_ID <= 0))
            {
                ShowWarning(SinhVienStringMapping.MSS_REQUIRE_CHOOSE_SV);
                e.Cancel = true;
            }
        }
        private void FrmSinhVienSearch_Load(object sender, EventArgs e)
        {

        }
        public int FilterMonHoc_ID
        {
            set
            {
                searchSinhVien1.FilterMonHoc_ID = value;
            }
        }

        public int FilterNamHoc_ID
        {
            set
            {
                searchSinhVien1.FilterNamHoc_ID = value;
            }
        }
        public int SelectedLop_ID
        {
            set
            {
                searchSinhVien1.SelectedLop_ID = value;
            }
        }
        public int KhoaHoc_ID
        {
            set
            {
                searchSinhVien1.KhoaHoc_ID = value;
            }
        }
        public int FilterHocKy_ID
        {
            set
            {
                searchSinhVien1.FilterHocKy_ID = value;
            }
        }
    }
}
